<%--
  Created by IntelliJ IDEA.
  User: xianfei
  Date: 2016-01-15
  Time: 9:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>AngularJs</title>
</head>
<body>
<div ng-app="admin_content" ng-controller="adminCtrl" style="width:80%;margin:20px auto">
    <button class="btn btn-default" @click="findAllAdminUser()">
        <span class="glyphicon glyphicon-search" aria-hidden="true"></span>显示所有管理员
    </button>
    <button class="btn btn-default" onclick="model()">
        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>添加管理员
    </button>
    <br/>
    <br/>
    <table class="table table-hover">
        <th>管理员编号</th>
        <th>管理员帐号</th>
        <th>管理员昵称</th>
        <th>管理操作</th>
        <tbody>
        <tr ng-repeat="admin in adminUser">
            <td>{{admin.guid}}</td>
            <td>{{admin.username}}</td>
            <td>{{admin.nickname}}</td>
            <td><a href="javascript">修改</a>&nbsp;
                <a href="javascript:" @click="resetPwd(admin)">重置密码</a>&nbsp;
                <a href="javascript:" @click="delAdminUser(admin)">删除</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>


<myScript>
    <script>
        var admin = angular.module('admin_content', []).controller('adminCtrl', function ($scope, $http) {
            $http.get('/admin/list/1').success(function (data) {
                $scope.adminUser = data.userDTOs;
            })
        });
    </script>
</myScript>
</body>
</html>
